package com.vm.osm.business.dto.req.logic_equ;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.base.MoreObjects;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Arrays;
import java.util.List;

/**
 * 设备分页请求
 *
 * @author Xuerong Xue
 */
@Data
public class PageAssetEquReq implements Serializable {
    @ApiModelProperty("字段类型（1：设备名称、2：设备编码、3：使用人、4：服务商、5：供应商、6：品牌、7：型号）")
    private Byte field_type;
    @ApiModelProperty("字段值")
    private String field_value;

    @ApiModelProperty("设备归属（1：自有设备、2：客户）")
    private Byte belong_type;

    @ApiModelProperty("设备归属者Id")
    private String belonger_id;

    @ApiModelProperty("部门Id")
    private String department_id;

    @ApiModelProperty("设备类型Id列表")
    private List<String> equ_type_ids;

    @ApiModelProperty(value = "分页数", required = true)
    @NotNull(message = "分页数不能为空")
    private Integer page_num;

    @ApiModelProperty(value = "分页大小", required = true)
    @NotNull(message = "分页大小不能为空")
    private Integer page_size;

    @ApiModelProperty(value = "会话Id", hidden = true)
    private String session_id;

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(this)
                .add("field_type", field_type)
                .add("field_value", field_value)
                .add("belong_type", belong_type)
                .add("belonger_id", belonger_id)
                .add("department_id", department_id)
                .add("equ_type_ids", null == equ_type_ids ? null : Arrays.toString(equ_type_ids.toArray()))
                .add("page_num", page_num)
                .add("page_size", page_size)
                .toString();
    }
}
